#pragma once

#include <QtWidgets/QDialog>
#include "ui_clientgui.h"
#include "Node.h"

class QTimer;
class clientgui : public QDialog
{
    Q_OBJECT

public:
    clientgui(QWidget *parent = Q_NULLPTR);

signals:
	void sigUpdateStatus(int status);
	void sigResponse(const QString &text);
	void sigUpdateResult();

private:
	void onConnect();
	void onSend();
	void onUpdateStatus(int status);
	void onUpdateResult();
	void onResponse(const QString &text);
	void onClearResponse();
	void onTimer();

private:
    Ui::clientguiClass ui;
	QList<wsbus::Node*> nodes_;
	QTimer *timer_;
	bool discardResponse_;
	qint64 msgElapsed_;
	int recvCount_;
};
